package com.github.jspxnet.worktask.model.param;

import com.github.jspxnet.enums.YesNoEnumType;
import com.github.jspxnet.sober.annotation.Column;
import com.github.jspxnet.sober.annotation.Nexus;
import com.github.jspxnet.sober.enums.MappingType;
import com.github.jspxnet.txweb.annotation.Param;
import com.github.jspxnet.utils.StringUtil;
import com.github.jspxnet.worktask.model.enums.*;
import com.github.jspxnet.worktask.table.ConfFlowJob;
import lombok.Data;
import java.io.Serializable;

/**
 * Created by jspx.net
 * author: chenYuan
 * date: 2021/9/29 23:37
 * description: jspx-framework
 **/
@Data
public class ConfFlowNodeParam  implements Serializable {
   
    @Param(caption = "ID")
    private long id = 0;

    @Param(caption = "命名空间")
    private String namespace = StringUtil.empty;

    @Param(caption = "流程编号")
    private String flowNo = StringUtil.empty;

    //不能等于本节点
    @Param(caption = "所属节点ID")
    private String nodeId = StringUtil.empty;

    @Param(caption = "节点名称")
    private String title = StringUtil.empty;

    //加签功能, 网关节点,使用网关里边的分支映射表
    @Param(caption = "父ID")
    private String parentNodeId = StringUtil.empty;

    @Param(caption = "节点类型",enumType = FlowNodeEnumType.class )
    private int flowNodeType = FlowNodeEnumType.START.getValue();

    //标识下一步是否有分支,或者合并
    @Param(caption = "网关类型",enumType = GatewayEnumType.class )
    private int gatWayType = GatewayEnumType.NONE.getValue();

    @Param(caption = "过程任务类型",enumType = JobEnumType.class )
    private int jobType = JobEnumType.NONE.getValue();

    @Param(caption = "节点工作")
    private ConfFlowJobParam confFlowJob = null;

    @Param(caption = "网关分支条件")
    private String wayScript = null;

    @Param(caption = "合并到节点")
    private String joinNodeId = StringUtil.empty;

    @Param(caption = "用户id列表")
    private String users = StringUtil.empty;

    //单个节点的特殊配置,-1 表示没有特殊配置是用 流程默认配置
    @Param(caption = "限时办理",enumType = YesNoEnumType.class )
    private int dueType = YesNoEnumType.NO.getValue();

    @Param(caption = "时间格式",enumType = DueDateFormatEnumType.class )
    private int dueDateFormat = DueDateFormatEnumType.CRON.getValue();

    /**
     R3/2004-05-06T130000+08/P0Y6M5DT3H0M0S。
     以1年2个月为循环间隔，无限次循环，最后循环终止于2025年1    月1日，可表示为R/P1Y2M/2025-01-01
     */
    //到期日期
    @Param(caption = "定时表达式")
    private String dueDateExp = StringUtil.empty;

    //超时到达的节点,超时到那个节点
    @Param(caption = "超时节点ID")
    private String dueNodeId = StringUtil.empty;

}
